home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / Jogos de Azar / 1721-apuesten.swf / scripts / C_VoiceButtonCLASS.as < prev   
Text File  |  2006-01-17  |  1KB  |  66 lines

  1. _global.C_VoiceButtonCLASS = function()
  2. {
  3.    this.voiceOn = true;
  4. };
  5. C_VoiceButtonCLASS.prototype = new MovieClip();
  6. C_VoiceButtonCLASS.prototype.onLoad = function()
  7. {
  8.    this.a_btn.addAlt(function()
  9.    {
  10.       if(this._parent.voiceOn)
  11.       {
  12.          this.showAlt("Turn dealer voice OFF");
  13.       }
  14.       else
  15.       {
  16.          this.showAlt("Turn dealer voice ON");
  17.       }
  18.    }
  19.    ,function()
  20.    {
  21.       this.hideAlt();
  22.    }
  23.    );
  24.    this.a_btn.onPress = function()
  25.    {
  26.       this.hideAlt();
  27.       this._parent.onButtonPress();
  28.    };
  29.    this.a_btn.useHandCursor = true;
  30. };
  31. C_VoiceButtonCLASS.prototype.lock = function()
  32. {
  33.    this.onRelease = function()
  34.    {
  35.    };
  36.    this.useHandCursor = false;
  37. };
  38. C_VoiceButtonCLASS.prototype.unlock = function()
  39. {
  40.    delete this.onRelease;
  41.    delete this.useHandCursor;
  42. };
  43. C_VoiceButtonCLASS.prototype.onButtonPress = function()
  44. {
  45.    if(this.voiceOn)
  46.    {
  47.       this.voiceOn = false;
  48.       this.a_btn._brightness = -50;
  49.       this.label_mc._brightness = -50;
  50.    }
  51.    else
  52.    {
  53.       this.voiceOn = true;
  54.       this.a_btn._brightness = 0;
  55.       this.label_mc._brightness = 0;
  56.    }
  57.    var c = this.client;
  58.    c.client[c.handler](this.voiceOn);
  59. };
  60. C_VoiceButtonCLASS.prototype.setChangeHandler = function(handler, client)
  61. {
  62.    this.client = {client:client,handler:handler};
  63. };
  64. ASSetPropFlags(_global,"C_VoiceButtonCLASS",131);
  65. Object.registerClass("C_VoiceButtonCLASS",C_VoiceButtonCLASS);
  66.